﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Package_Civilisation;
using Package_Civilisation.Package_Unite;

namespace CivilisationIHM.Ressources
{
    public class KillException : System.ApplicationException
    {
    public KillException() {}
    public KillException(string message) : base(message) {  }
    public KillException(string message, System.Exception inner) {}

    public KillException(Unite u)
    {
        String joueur = u.civilisation.joueur.pseudonyme;
        String uniteName = u.name;
        String mess = joueur + " a perdu un " + uniteName + " ! ";
        u = null;
        throw new KillException(mess);
    }
    // Constructor needed for serialization 
    // when exception propagates from a remoting server to the client.
    protected KillException(System.Runtime.Serialization.SerializationInfo info,
        System.Runtime.Serialization.StreamingContext context) {}
    }
}
